<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <th:block th:insert="~{include :: header('新增会员开通记录')}" />
    <th:block th:insert="~{include :: datetimepicker-css}" />
</head>
<body class="hold-transition">
<div class="container-fluid mt-2 mb-2">
        <form class="form-horizontal m" id="form-record-add" th:object="${memberRecord}">
            <div class="form-group row">
                <label class="col-sm-3 col-form-label text-sm-right">修改时间</label>
                <input id="yqTime" class="form-control col-sm-4" placeholder="延期时间必须大于到期时间" type="text">
            </div>
        </form>
    </div>
    <th:block th:insert="~{include :: footer}" />
    <th:block th:insert="~{include :: datetimepicker-js}" />
    <script type="text/javascript">
        var id = [[${memberRecord.id}]]
        $("#yqTime").datetimepicker({
            format:'Y-m-d',
            formatDate:'Y-m-d',
            timepicker: false,
            step: 5
        });

       function submitHandler() {
           var stopTime = $("#yqTime").val();
           if (stopTime == "") {
               $.modal.msgError('延期时间不能为空！')
               return false;
           }
           $.modal.confirm("确认执行延期操作", function () {
               var data = {"id": id, "stopTime": stopTime};
               $.operate.submit("/member/record/delay.json", "post", "json", data, function (json) {
                   if (json.code === 0) {
                       window.parent.layer.closeAll();
                       window.parent.$.modal.msgSuccess(json.msg);
                       window.parent.$.form.reset();
                   }
               });
           });
       }
    </script>
</body>
</html>